import request from '@/module/flow/utils/request';

const BASE_URL = '/flow/events'


export function createOne(data) {
  return request({
    url: BASE_URL,
    method: 'post',
    data: data
  })
}
/**
 * 获取单个信息
 * @param {*} id 
 * @returns 
 */
export function queryOne(id) {
  return request({
    url: BASE_URL + '/' + id,
    method: 'get'
  })
}


export function queryAll() {
  return request({
    url: BASE_URL,
    method: 'get'
  })
}

export function queryList(query) {
  return request({
    url: BASE_URL,
    method: 'get',
    params: query
  })
}

export function updateOne(data) {
  return request({
    url: BASE_URL,
    method: 'put',
    data: data
  })
}

export function updateExt(data) {
  return request({
    url: "/system/job/ext",
    method: 'put',
    data: data
  })
}

export function deleteOne(id) {
  return request({
    url: BASE_URL + '/' + id,
    method: 'delete'
  })
}

export function queryEventSps(eventId){
    return request({
      url: BASE_URL + '/' + eventId+ '/consumers',
      method: 'get'
    })
  }